package com.xia.juan.work.enums;

import cn.hutool.core.io.FileUtil;

/**
 * @author wang
 */
public enum FileTypeEnum {

    TXT("txt"),

    EXCEL("xlsx,xls"),
    ;

    private final String type;

    FileTypeEnum(String type) {
        this.type = type;
    }

    public String getType() {
        return type;
    }

    public static FileTypeEnum getFileTypeEnum(String extName) {
        for (FileTypeEnum fileTypeEnum : FileTypeEnum.values()) {
            if (fileTypeEnum.getType().contains(extName)) {
                return fileTypeEnum;
            }
        }
        return null;
    }
}
